package cn.com.dhcc.turbo.entity.registry;

import java.io.Serializable;
import java.util.Date;

import cn.com.dhcc.app.core.annotation.SiColumn;
import cn.com.dhcc.app.core.annotation.SiNotDbColumn;
import cn.com.dhcc.app.core.annotation.SiTable;
import cn.com.dhcc.app.core.base.ModuleFeatureBean;
import cn.com.dhcc.app.pub.core.consts.NodeInfoParam.NET_TYPE;

/**
 * turbo_node_info 节点基本信息表vo
 * 
 * @日期：2014-5-12 上午11:28:36
 * @作者：张洪涛
 * @版权所有：东华软件
 * @版本：1.0
 */
@SiTable(name = "turbo_node_info")
public class NodeInfo extends ModuleFeatureBean implements Serializable{

	private static final long serialVersionUID = 1L;
	@SiColumn(isId = true)
	private String id;// 主键
	@SiColumn(name = "node_code")
	private String nodeCode; // 节点编码
	private String pid; // 父级ID
	@SiNotDbColumn
	private String pcode; // 父级编码
	@SiColumn(name = "node_name")
	private String nodeName;// 节点名称，非空
	private String isLocal;// 是否本地结节　0非本地　1本地
	private String remark;// 备注
	private String status;// 状态：0 删除1 待审批 2 可用
	private Date mtime;// 最后修改时间
	@SiColumn(name = "install_url")
	private String installUrl;
	private String adminEmail;
	@SiColumn(name = "has_gap")
	private String hasGap;
	@SiColumn(name = "net_type")
	private String netType;//网络类型　1 内 2 外
	@SiColumn(name = "is_mgr_node")
	private String isMgrNode;//是否为管理节点　1 管理节点　2　非管理节点
	
	@SiNotDbColumn
	private String pname;// 父级节点名称
	@SiNotDbColumn
	private String orgType;// 所属行政区类型
	@SiNotDbColumn
	private String cont;// 子节点数
	@SiNotDbColumn
	private String isrel;// 是否关系节点

	

	public String getIsrel() {
		return isrel;
	}

	public void setIsrel(String isrel) {
		this.isrel = isrel;
	}

	public String getPcode() {
		return pcode;
	}

	public void setPcode(String pcode) {
		this.pcode = pcode;
	}

	public String getIsMgrNode() {
		return isMgrNode;
	}

	public void setIsMgrNode(String isMgrNode) {
		this.isMgrNode = isMgrNode;
	}

	public String getNodeCode() {
		return nodeCode;
	}

	public void setNodeCode(String nodeCode) {
		this.nodeCode = nodeCode;
	}

	public String getNodeName() {
		return nodeName;
	}

	public void setNodeName(String nodeName) {
		this.nodeName = nodeName;
	}

	public String getIsLocal() {
		return isLocal;
	}

	public void setIsLocal(String isLocal) {
		this.isLocal = isLocal;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public Date getMtime() {
		return mtime;
	}

	public void setMtime(Date mtime) {
		this.mtime = mtime;
	}

	public String getPname() {
		return pname;
	}

	public void setPname(String pname) {
		this.pname = pname;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getPid() {
		return pid;
	}

	public void setPid(String pid) {
		this.pid = pid;
	}

	public String getInstallUrl() {
		return installUrl;
	}

	public void setInstallUrl(String installUrl) {
		this.installUrl = installUrl;
	}

	public String getOrgType() {
		return orgType;
	}

	public void setOrgType(String orgType) {
		this.orgType = orgType;
	}

	public String getAdminEmail() {
		return adminEmail;
	}

	public void setAdminEmail(String adminEmail) {
		this.adminEmail = adminEmail;
	}

	public String getCont() {
		return cont;
	}

	public void setCont(String cont) {
		this.cont = cont;
	}

	
	public String getHasGap() {
		return hasGap;
	}

	public void setHasGap(String hasGap) {
		this.hasGap = hasGap;
	}

	public String getNetType() {
		return netType;
	}

	public void setNetType(String netType) {
		this.netType = netType;
	}

	public String getNetTypeCode() {
		String netCode = nodeCode.substring(6, 7);
		if (NET_TYPE.EXTRA.getCode().equals(netCode)) {
			return NET_TYPE.EXTRA.getCode();
		} else if (NET_TYPE.INNER.getCode().equals(netCode)) {
			return NET_TYPE.INNER.getCode();
		} else {
			return "";
		}
	}

	public String netTypeName() {
		String netCode = nodeCode.substring(6, 7);
		if (NET_TYPE.EXTRA.getCode().equals(netCode)) {
			return NET_TYPE.EXTRA.getName();
		} else if (NET_TYPE.INNER.getCode().equals(netCode)) {
			return NET_TYPE.INNER.getName();
		} else {
			return "";
		}
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		NodeInfo other = (NodeInfo) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "NodeInfo [id=" + id + ", nodeCode=" + nodeCode + ", pid=" + pid
				+ ", pcode=" + pcode + ", nodeName=" + nodeName + ", isLocal="
				+ isLocal + ", remark=" + remark + ", status=" + status
				+ ", mtime=" + mtime + ", installUrl=" + installUrl
				+ ", adminEmail=" + adminEmail + ", hasGap=" + hasGap
				+ ", netType=" + netType + ", isMgrNode=" + isMgrNode
				+ ", pname=" + pname + ", orgType=" + orgType + ", cont="
				+ cont + "]";
	}
}
